package com.minyon_web_admin.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
 
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.minyon_web_admin.common.base.BaseController;
import com.minyon_web_admin.model.SysMenuBean;
import com.minyon_web_admin.server.ISysMenu;
import com.minyon_web_admin.server.ISysUser;

@Controller
public class MainController extends BaseController {
	@Autowired
	ISysMenu menuService;
	@RequestMapping(value = "/index.shtml")
	public String index(Model model,HttpServletRequest request) {
		@SuppressWarnings("unchecked")
		Map<String,Object> reqMap=new HashMap<String,Object>();
		List<SysMenuBean> list=(List<SysMenuBean>) getResultMap(menuService.queryListInfo(reqMap),false);
		model.addAttribute("menuList",list);
		return "/index";
	}
	
	/**
	 * 登录.  
	 * @param model
	 * @param request
	 * @return
	 */
	 @RequestMapping(value = "/login.shtml",method=RequestMethod.GET)
	public String login(Model model,HttpServletRequest request) {
		return "/login";
	}
	
}
